// 引入createApp用于创建应用
import {createApp} from "vue";
// 引入App根组件
import App from './App.vue'
import Hello from './Hello.vue'
import { createPinia } from 'pinia'

const app = createApp(App)
app.component('Hello',Hello)

// vue2:Vue.prototype.$name = '张三'
app.config.globalProperties.$name = '张三'
// 解决飘红
declare module 'vue' {
  interface ComponentCustomProperties {
    $name: string
  }
}

app.directive('beauty',(el,{value})=>{
  el.style.color = 'red'
})

app.use(createPinia())

// 挂载应用
app.mount('#app')

// 挂载
setTimeout(()=>{
  app.unmount()
},3000)
